import { Injectable } from '@angular/core';
import { Employee } from './employee';

const NAMES = [
  'Anne Hull',
  'Lara Armstrong',
  "Chaim O'Neill",
  'Tatiana Keller',
  'Jed Navarro',
  'Cecil Torres',
  'Samara Gibson',
  'Orla Shannon',
  'Louise Aguirre',
  'Jacob Trujillo',
  'Eesa Mcguire',
  'Eden Johnston',
  'Reggie Dunlap',
  'Alfred Lucas',
  'Tiana Livingston',
  'Imogen Ballard',
  'Tiago Thornton',
  'Marwa Hoffman',
  'Angus Freeman',
  'Kelly Lynn',
  'Oliver Ponce',
  'Alisha Mcdowell',
  'Zoe Garcia',
  'Marjorie Cline',
  'Carter Monroe',
  'Hugo Chase',
  'Sumaya Parker',
  'John Osborne',
  'Lucie Meyer',
  'Kaine Maxwell',
  'Gordon Wells',
  'Mohsin Haas',
  'Calum Wang',
  'Beau Pollard',
  'Owais Potts',
  'Timothy Marks',
  'Keyaan Benton',
  'Larissa Hodge',
  'Isaiah Cooper',
  'Minnie Solomon',
  'Jimmy Connor',
  'Zainab Nelson',
  'Harriett Pearce',
  'Jac Bradford',
  'Ray Leblanc',
  'Evelyn Beck',
  'Dawud Manning',
  'Mary Yang',
  'Oskar Salazar',
  'Colin Webster',
  'Roxanne Sandoval',
  'Constance Kirby',
  'Brayden Cantrell',
  'Maliha Waller',
  'Peter Hendricks',
  'Frank Horn',
  'Alex Sosa',
  'Ethan Rosales',
  'Keenan Matthams',
  'Archibald Knowles',
  'Whitney Medina',
  'Amira Fletcher',
  'Fatima Valdez',
  'Honey Stephenson',
  'Robin Escobar',
  'Anjali Nicholson',
  'Dominik Ferrell',
  'Kaya Pierce',
  'Lily-Rose Williams',
  'Szymon Woods',
  'Danyal Gibbs',
  'Haider Hobbs',
  'Rebekah Blankenship',
  'Oliver Parrish',
  'Lewis Melton',
  'Ayla Serrano',
  'Gwen Blanchard',
  'Bernard Mccann',
  'Rory Cotton',
  'Chelsea Crane',
  'Anoushka Frye',
  'Peter Morgan',
  'Penny Wiggins',
  'Isha Harrell',
  'Daniyal Graves',
  'Zachery Wall',
  'Elijah Cameron',
  'Louisa Ortiz',
  'Marcel Duffy',
  'Mila Nixon',
  'Woody Pham',
  "Alice O'Moore",
  'Mohammed Klein',
  'Natasha Mccarty',
  'Taylor Barnett',
  'Zach Goodman',
  'Fatima Torres',
  'Dawson Massey',
  'Ayrton Mckenzie',
  'Shakira Rasmussen',
  'Riley Gregory',
  'Asma Jordan',
  'Junior Barrera',
  'Rosalie Howard',
  'Mario Huber',
  'Nancy Brandt',
  'Jon Parker',
  'Liberty Gilbert',
  'Amaya Johnston',
  'Albert Flores',
  'Catrin Ray',
  'Milan Friedman',
  'Thea Wyatt',
  'Chelsey Bullock',
  'Jan Hayes',
  'Keisha Arroyo',
  'Jean Schmidt',
  'Daniel Lin',
  'Anna Salas',
  'Skyla Villarreal',
  'Lucille Ruiz',
  'Ariana Freeman',
  'Jak Chandler',
  'Ameera Hernandez',
  'Fahad Reynolds',
  'Annie Mcguire',
  'Eva Walsh',
  'Jessica Stephens',
  'Husna Mclaughlin',
  'Duncan Estrada',
  'Karl Moyer',
  'Claudia Mayo',
  'Carly Knight',
  'Hana Carver',
  'Jennifer Murphy',
  'Virginia Cisneros',
  'Lorna Sutherland',
  'Vinnie Doyle',
  'Damon Simon',
  'Georgia Long',
];

@Injectable({
  providedIn: 'root',
})
export class DataGeneratorService {
  constructor() {}

  generate(nameRange: [number, number], numberRange: [number, number]) {
    const result: Employee[] = [];
    for (let index = nameRange[0]; index < nameRange[1]; index++) {
      const name = NAMES[index];
      result.push({
        name,
        rand: this.rand(numberRange),
      });
    }
    return result;
  }

  rand(numberRange: [number, number]) {
    return Math.floor(Math.random() * (numberRange[1] - numberRange[0]) + numberRange[0]);
  }
}
